{extend name="base" /}
{block name="cont"}
<div class="row">
    <div class="col-xs-12">

        <div class="row">
            <div class="col-xs-12">
                <h3 class="header smaller lighter blue"></h3>
                <div class="table-header">
                    订单管理
                </div>
                <form class="form-search form-block" method="post" action="{:url('index')}" style="margin: 20px 0;display: flex;align-items: center ">
                    订单号：
                    <div class="input-group">
                        <input type="text" name="order_num" value="" class="input-sm search-query" placeholder="订单号">
                    </div>
                    &nbsp;&nbsp;
                    下单手机：
                    <div class="input-group">
                        <input type="text" name="order_phone" value="" class="input-sm search-query" placeholder="下单手机号">
                    </div>
                    &nbsp;&nbsp;
                    时间区间：
                    <div class="input-group">
                        <input type="date" name="start_date"  value="" class="input-sm search-query date-picker"  placeholder="起始日期">
                        -
                        <input type="date" name="end_date" value="" class="input-sm search-query date-picker"  placeholder="截止日期">
                    </div>


                    <div class="input-group">
                        <button type="submit" class="btn btn-info btn-sm">
                            <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                            搜索
                        </button>
                    </div>
                </form>

                <div class="table-responsive">
                    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>id</th>
                            <th>订单号</th>
                            <th>用户id</th>
                            <th>备注</th>
                            <th>下单人</th>
                            <th>下单电话</th>
                            <th>下单地址</th>
                            <th>配送费</th>
                            <th>状态</th>
                            <th>配送员姓名</th>
                            <th>配送员电话</th>
                            <th>下单时间</th>
                            <th>过期时间</th>
                        </tr>
                        </thead>

                        <tbody>
                        {foreach $orders as $k=>$v}
                        <tr>
                            <td>{$v.order_id}</td>
                            <td>{$v.order_num}</td>
                            <td>{$v.user_id}</td>
                            <td>{$v.order_content}</td>
                            <td>{$v.user_name}</td>
                            <td>{$v.user_phone}</td>
                            <td>{$v.user_address}</td>
                            <td>{$v.order_price}元</td>
                            {if $v.order_status==1}
                            <td class="text-danger">未接单</td>
                            {elseif $v.order_status==2 /}
                            <td class="text-info">配送中</td>
                            {elseif $v.order_status==3 /}
                            <td class="text-success">完成</td>
                            {else /}
                            <td class="text-success">已退款</td>
                            {/if}
                            {if $v.tuple_msg}
                             <td class="text-success">{$v.tuple_msg.user_name}</td>
                            {else /}
                             <td class="text-danger">暂未接单</td>
                            {/if}
                            {if $v.tuple_msg}
                            <td class="text-success">{$v.tuple_msg.user_phone}</td>
                            {else /}
                            <td class="text-danger">暂未接单</td>
                            {/if}
                            <td>{:date('Y-m-d H:i:s',$v.order_ctime)}</td>
                            <td>{:date('Y-m-d H:i:s',$v.order_outtime)}</td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>


    </div><!-- /.col -->
</div>
{/block}